import request from "@/utils/request";

/**  律所数据分页查询参数 */
export interface LawFirmQuery {
  current?: number;
  pageSize?: number;
  cityNo?: string;
  lawFirmName?: string;
}
/** 律所表单 */
export interface LawFirmForm {
  id?: number;
  address: string;
  belongCityName: string;
  belongCityNo?: string;
  createdAt: string;
  lawFirmName: string;
  lawFirmNo?: number;
  phone: string;
  updateAt: string;
}
/** 律所数据分页对象 */
export interface LawFirmVO {
  address: string;
  belongCityName: string;
  belongCityNo: string;
  createdAt: string;
  id: number;
  lawFirmName: string;
  lawFirmNo: number;
  phone: string;
  updateAt: string;
  records?: any;
  current?: number;
  pages?: number;
  size?: number;
  total: number;
}
class lawfirmAPI {
  /** 获取分页律所列表 */
  static getLawfirm(params: LawFirmQuery) {
    return request<any, LawFirmVO>({
      url: "/api/law_firm/getPage",
      method: "post",
      data: params,
    });
  }
  /** 获取分页律所列表 */
  static getLawfirmAll() {
    return request<any, LawFirmVO[]>({
      url: "/api/law_firm",
      method: "get",
      // data: params,
    });
  }
  /** 根据id获取律所数据列表 */
  static getLawfirmById(id: number) {
    return request<any, LawFirmVO>({
      url: `/api/law_firm/${id}`,
      method: "get",
      // data: params,
    });
  }
  /** 新增+修改 律所信息 */
  static updateLawfirm(params: LawFirmForm) {
    return request<any, PageResult<LawFirmVO[]>>({
      url: "/api/law_firm",
      method: "post",
      data: params,
    });
  }
  /** 根据id删除律所信息 */
  static deleteLawfirm(id: number) {
    return request({
      url: `/api/law_firm/${id}`,
      method: "delete",
      // data: params,
    });
  }
  /** 批量删除律所信息 */
  static deleteLawfirmBatch(ids: string) {
    return request({
      url: `/api/lawyer_info/deleteBatch?ids=${ids}`,
      method: "delete",
      // data: ids,
    });
  }
}

export default lawfirmAPI;
